<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定位的层级</title>
</head>
<style>
    /*定位的层级是一样的，但是可以使用z-index使它在z轴上移动到最上层*/

    .container {
        width: 500px;
        height: 500px;
        background-color: gray;
        margin: 10px;
    }

    .box_1, .box_2, .box_3, .box_4 {
        width: 100px;
        height: 100px;
    }

    /*div > span {*/
    /*    display: flex;*/
    /*    width: 100%;*/
    /*    height: 100%;*/
    /*    justify-content: center;*/
    /*    align-items: center;*/
    /*}*/

    .box_1 {
        background-color: aliceblue;
    }

    .box_2 {
        background-color: antiquewhite;
        position: relative;
        top: -75px;
        left: 25px;
        /*z-index: ; 意思是在z轴上移动*/
        z-index: 2;
    }

    .box_3 {
        background-color: aquamarine;
        position: absolute;
        top: 55px;
        left: 65px;
        z-index: 1;
    }

    .box_4 {
        background-color: cyan;
        position: fixed;
        top: 75px;
        left: 85px;
        z-index: 3;
    }
</style>
<body>
<div class="container">
    <div class="box_1"><span>111</span></div>
    <div class="box_2"><span>222</span></div>
    <div class="box_3"><span>333</span></div>
    <div class="box_4"><span>444</span></div>
</div>

</body>
</html>